From: Øyvind Kolås Date: Wed, 26 Jan 2022 03:38:53 +0000 (+0100) Subject: new symbol babl_fish_get_process X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2~4^2~24 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=e71b7e9054edb527f78ea2d91328b3b53e9e7eb6;p=babl.git new symbol babl_fish_get_process This permits some APIs to avoid a function call per dispatch, specifically the samplers in GeglBuffer. --- diff --git a/babl/babl-fish.c b/babl/babl-fish.c index ce22b6b..aece33b 100644 --- a/babl/babl-fish.c +++ b/babl/babl-fish.c @@ -359,4 +359,10 @@ babl_fish (const void *source, } } + +BablFishProcess babl_fish_get_process (const Babl *babl) +{ + return babl->fish.dispatch; +} + BABL_CLASS_MINIMAL_IMPLEMENT (fish); diff --git a/babl/babl.h b/babl/babl.h index 4032faa..04bc00a 100644 --- a/babl/babl.h +++ b/babl/babl.h @@ -713,6 +713,17 @@ const char * babl_format_get_encoding (const Babl *babl); int babl_space_is_cmyk (const Babl *space); int babl_space_is_gray (const Babl *space); +typedef void (*BablFishProcess) (const Babl *babl, const char *src, char *dst, long n, void *data); +/** + * babl_fish_get_dispatch: (skip) + * + * get the dispatch function of a fish, this allows faster use of a fish + * in a loop than the more indirect method of babl_process, this also avoids + * base-level instrumentation. + */ +BablFishProcess babl_fish_get_process (const Babl *babl); + + /* values below this are stored associated with this value, it should also be * used as a generic alpha zero epsilon in GEGL to keep the threshold effects * on one known value. diff --git a/export-symbols b/export-symbols index 420ef87..07b4e95 100644 --- a/export-symbols +++ b/export-symbols @@ -78,6 +78,7 @@ babl_conversion_class_for_each babl_set_extender babl_extension_quiet_log babl_fish_path +babl_fish_get_process babl_extender babl_class_name babl_sanity